<template>
  <div class="user">
    <div class="search">
      <UserSearch @query-click="handleQueryClick" @reset-Click="handleResetClick" />
    </div>
    <div class="content">
      <UserContent ref="contentRef" @edit-click="handleEditClick" />
    </div>
    <!-- 对话框 -->
    <userModal ref="modalRef" />
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import userModal from './c-cpns/user-modal.vue'
import UserSearch from './c-cpns/user-search.vue'
import UserContent from './c-cpns/user-content.vue'
const contentRef = ref<InstanceType<typeof UserContent>>()
function handleQueryClick(formdata: any) {
  console.log(formdata)
  contentRef.value?.fetchUsersListData(formdata)
}
// 重置
function handleResetClick(formData = {}) {
  contentRef.value?.fetchUsersListData(formData)
}
const modalRef = ref<InstanceType<typeof userModal>>()
// 编辑
function handleEditClick(row?: any) {
  console.log(row)
  modalRef.value?.open(true)
}
</script>

<style lang="less" scoped></style>
